/******************************************************************************
* This file is part of is32p218 platform,
* Copyright (c) 2009 HangZhou InfoStrong CO.,LTD. All rights reserved.
* This software may only be used under the terms of a valid, current,
* end user license from InfoStrong.
* Nothing else gives you the right to use this software.   
*
* Name:   drv_utils.h
* Desc:   Utility header file
* Author: Jerry
* Date:   2009-10-14
* Note:   
* History:
*
******************************************************************************/
#include "def.h"

#ifndef __DRV_UTILS_H__
#define __DRV_UTILS_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef struct
{
	U16 m_wr_idx;
	U16 m_rd_idx;
	U16 m_num;
	U16 m_idx_max;
	U8 *m_p_buff;
}FIFO_CTRL_T;

U16 drv_utils_crc16( const U8 *p_data, U32 len );
U32 drv_utils_cs_calc( const U8 *p_data, U32 cs_len, U8 mode );
BOOL drv_utils_fifo_push( FIFO_CTRL_T *p_fifo_obj, U8 in_data );
BOOL drv_utils_fifo_pop( FIFO_CTRL_T *p_fifo_obj, U8 *p_out_data );
U16 drv_utils_fifo_num( FIFO_CTRL_T *p_fifo_obj );
#ifdef __cplusplus
}
#endif

#endif /*__INT_H__*/


